﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.OleDb;

/// <summary>
/// ExcelHelper 的摘要说明
/// </summary>
public class ExcelHelper
{
    	public ExcelHelper()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//
	}
    private OleDbConnection conn;
    private string connStr = "Provider=Microsoft.Ace.OleDb.12.0;Data Source={0};Extended Properties='Excel 12.0;HDR=yes'";
    public ExcelHelper(string fileName)
    {
        connStr = string.Format(connStr, fileName);//操作的文件路径早调用对象时给定
        Conn = new OleDbConnection(connStr);
    }

    public OleDbConnection Conn
    {
        get
        {
            return conn;
        }

        set
        {
            conn = value;
        }
    }
}